import { createCrudApi } from '@/utils/apiFactory';
import request from '@/utils/unirequest';
import type { ISysHrRecruitPublishRequestBill, ISysHrRecruitPublishRequestBillView, ISysHrRecruitPublishRequestBillVm } from './interface';

export default function SysHrRecruitPublishRequestBillApi() {
  // 基础CRUD用工厂生成
  const baseCrud = createCrudApi<
    ISysHrRecruitPublishRequestBillView,
    ISysHrRecruitPublishRequestBillVm,
    ISysHrRecruitPublishRequestBill
  >('/api/SysHrRecruitPublishRequestBill');

  return {
    ...baseCrud,
    // 额外的特殊接口

    // 审核接口
    async approve(data: ISysHrRecruitPublishRequestBillVm): Promise<ISysHrRecruitPublishRequestBill> {
      return await request.post('/api/SysHrRecruitPublishRequestBill/approve?tag=', data);
    },
  };
}
